package com.ldzl.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * 仓库表
 * @TableName ck_warehouse
 */
@TableName(value ="ck_warehouse")
@Data
public class CkWarehouse implements Serializable {
    /**
     * 仓库ID
     */
    @TableId(type = IdType.AUTO)
    private Long warehouse_id;

    /**
     * 仓库编码
     */
    private String warehouse_code;

    /**
     * 仓库名称
     */
    private String warehouse_name;

    /**
     * 仓库位置
     */
    private String location;

    /**
     * 仓库面积
     */
    private Double area;

    /**
     * 负责人ID
     */
    private Long charge_id;

    /**
     * 负责人名称
     */
    private String charge_name;

    /**
     * 是否冻结
     */
    private String frozen_flag;

    /**
     * 父分类id
     */
    private Long material_classification_id;

    /**
     * 备注
     */
    private String remark;

    /**
     * 预留字段1
     */
    private String attr1;

    /**
     * 预留字段2
     */
    private String attr2;

    /**
     * 预留字段3
     */
    private Integer attr3;

    /**
     * 预留字段4
     */
    private Integer attr4;

    /**
     * 创建者
     */
    private String create_by;

    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date create_time;

    /**
     * 更新者
     */
    private String update_by;

    /**
     * 更新时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date update_time;

    /**
     * 删除标志（0代表存在 1代表删除）
     */
    private String is_delete;

    /**
     * 当前已用容量
     */
    @TableField(exist = false)
    private BigDecimal used_capacity;

    /**
     * 仓库 → 库区
     */
    @TableField(exist = false)
    private List<CkStorageLocation> locations;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        CkWarehouse other = (CkWarehouse) that;
        return (this.getWarehouse_id() == null ? other.getWarehouse_id() == null : this.getWarehouse_id().equals(other.getWarehouse_id()))
            && (this.getWarehouse_code() == null ? other.getWarehouse_code() == null : this.getWarehouse_code().equals(other.getWarehouse_code()))
            && (this.getWarehouse_name() == null ? other.getWarehouse_name() == null : this.getWarehouse_name().equals(other.getWarehouse_name()))
            && (this.getLocation() == null ? other.getLocation() == null : this.getLocation().equals(other.getLocation()))
            && (this.getArea() == null ? other.getArea() == null : this.getArea().equals(other.getArea()))
            && (this.getCharge_id() == null ? other.getCharge_id() == null : this.getCharge_id().equals(other.getCharge_id()))
            && (this.getCharge_name() == null ? other.getCharge_name() == null : this.getCharge_name().equals(other.getCharge_name()))
            && (this.getFrozen_flag() == null ? other.getFrozen_flag() == null : this.getFrozen_flag().equals(other.getFrozen_flag()))
            && (this.getMaterial_classification_id() == null ? other.getMaterial_classification_id() == null : this.getMaterial_classification_id().equals(other.getMaterial_classification_id()))
            && (this.getRemark() == null ? other.getRemark() == null : this.getRemark().equals(other.getRemark()))
            && (this.getAttr1() == null ? other.getAttr1() == null : this.getAttr1().equals(other.getAttr1()))
            && (this.getAttr2() == null ? other.getAttr2() == null : this.getAttr2().equals(other.getAttr2()))
            && (this.getAttr3() == null ? other.getAttr3() == null : this.getAttr3().equals(other.getAttr3()))
            && (this.getAttr4() == null ? other.getAttr4() == null : this.getAttr4().equals(other.getAttr4()))
            && (this.getCreate_by() == null ? other.getCreate_by() == null : this.getCreate_by().equals(other.getCreate_by()))
            && (this.getCreate_time() == null ? other.getCreate_time() == null : this.getCreate_time().equals(other.getCreate_time()))
            && (this.getUpdate_by() == null ? other.getUpdate_by() == null : this.getUpdate_by().equals(other.getUpdate_by()))
            && (this.getUpdate_time() == null ? other.getUpdate_time() == null : this.getUpdate_time().equals(other.getUpdate_time()))
            && (this.getIs_delete() == null ? other.getIs_delete() == null : this.getIs_delete().equals(other.getIs_delete()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getWarehouse_id() == null) ? 0 : getWarehouse_id().hashCode());
        result = prime * result + ((getWarehouse_code() == null) ? 0 : getWarehouse_code().hashCode());
        result = prime * result + ((getWarehouse_name() == null) ? 0 : getWarehouse_name().hashCode());
        result = prime * result + ((getLocation() == null) ? 0 : getLocation().hashCode());
        result = prime * result + ((getArea() == null) ? 0 : getArea().hashCode());
        result = prime * result + ((getCharge_id() == null) ? 0 : getCharge_id().hashCode());
        result = prime * result + ((getCharge_name() == null) ? 0 : getCharge_name().hashCode());
        result = prime * result + ((getFrozen_flag() == null) ? 0 : getFrozen_flag().hashCode());
        result = prime * result + ((getMaterial_classification_id() == null) ? 0 : getMaterial_classification_id().hashCode());
        result = prime * result + ((getRemark() == null) ? 0 : getRemark().hashCode());
        result = prime * result + ((getAttr1() == null) ? 0 : getAttr1().hashCode());
        result = prime * result + ((getAttr2() == null) ? 0 : getAttr2().hashCode());
        result = prime * result + ((getAttr3() == null) ? 0 : getAttr3().hashCode());
        result = prime * result + ((getAttr4() == null) ? 0 : getAttr4().hashCode());
        result = prime * result + ((getCreate_by() == null) ? 0 : getCreate_by().hashCode());
        result = prime * result + ((getCreate_time() == null) ? 0 : getCreate_time().hashCode());
        result = prime * result + ((getUpdate_by() == null) ? 0 : getUpdate_by().hashCode());
        result = prime * result + ((getUpdate_time() == null) ? 0 : getUpdate_time().hashCode());
        result = prime * result + ((getIs_delete() == null) ? 0 : getIs_delete().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", warehouse_id=").append(warehouse_id);
        sb.append(", warehouse_code=").append(warehouse_code);
        sb.append(", warehouse_name=").append(warehouse_name);
        sb.append(", location=").append(location);
        sb.append(", area=").append(area);
        sb.append(", charge_id=").append(charge_id);
        sb.append(", charge_name=").append(charge_name);
        sb.append(", frozen_flag=").append(frozen_flag);
        sb.append(", material_classification_id=").append(material_classification_id);
        sb.append(", remark=").append(remark);
        sb.append(", attr1=").append(attr1);
        sb.append(", attr2=").append(attr2);
        sb.append(", attr3=").append(attr3);
        sb.append(", attr4=").append(attr4);
        sb.append(", create_by=").append(create_by);
        sb.append(", create_time=").append(create_time);
        sb.append(", update_by=").append(update_by);
        sb.append(", update_time=").append(update_time);
        sb.append(", is_delete=").append(is_delete);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}